<div class="gf-form-group">
	<h3 class="page-heading">HTTP</h3>
  <div class="gf-form-group">
    <div class="gf-form-inline">
      <div class="gf-form max-width-30">
        <span class="gf-form-label width-10">URL</span>
        <input class="gf-form-input gf-form-input--has-help-icon" type="text"
              ng-model='current.url' placeholder="{{suggestUrl}}"
              bs-typeahead="getSuggestUrls"  min-length="0"
              ng-pattern="/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/" required></input>
        <info-popover mode="right-absolute">
          <p>指定完整的http url（例如http://your server:8080）</p>
          <span ng-show="current.access === 'direct'">
			您的访问方法是<em>browser</em>，这意味着需要从浏览器访问url。
          </span>
          <span ng-show="current.access === 'proxy'">
			您的访问方法是<em>server</em>，这意味着需要从grafana后端/服务器访问url
          </span>
        </info-popover>
      </div>
		</div>

		<div class="gf-form-inline" ng-if="showAccessOption">
			<div class="gf-form max-width-30">
				<span class="gf-form-label width-10">访问</span>
				<div class="gf-form-select-wrapper max-width-24">
					<select class="gf-form-input" ng-model="current.access" ng-options="f.key as f.value for f in [{key: 'proxy', value: 'Server (Default)'}, { key: 'direct', value: 'Browser'}]"></select>
				</div>
			</div>
			<div class="gf-form">
				<label class="gf-form-label query-keyword pointer" ng-click="toggleAccessHelp()">
					帮助&nbsp;
					<i class="fa fa-caret-down" ng-show="showAccessHelp"></i>
					<i class="fa fa-caret-right" ng-hide="showAccessHelp">&nbsp;</i>
				</label>
			</div>
		</div>

		<div class="grafana-info-box m-t-2" ng-show="showAccessHelp">
			<p>
		访问模式控制如何处理对数据源的请求。 如果没有其他说明，<strong> <i>服务器</i>
				</strong>应该是首选方式。
			</p>
			<div class="alert-title">服务器访问模式（默认）:</div>
			<p>
			所有请求都将从浏览器发送到Grafana ackend / server，后者又将请求转发到数据源，并通过这种方式规避可能的跨源资源共享（CORS）要求。 如果选择此访问模式，则需要从grafana后端/服务器访问URL。
			</p>
			<div class="alert-title">浏览器访问模式:</div>
			<p>
			所有请求都将从浏览器直接发送到数据源，并可能受到跨源资源共享（CORS）要求的约束。 如果选择此访问模式，则需要从浏览器访问URL。
		</div>

		<div class="gf-form-inline" ng-if="current.access=='proxy'">
			<div class="gf-form">
				<span class="gf-form-label width-10">Cookies 白名单</span>
				<bootstrap-tagsinput ng-model="current.jsonData.keepCookies" width-class="width-20 gf-form-input--has-help-icon" tagclass="label label-tag" placeholder="添加cookie名">
				</bootstrap-tagsinput>
				<info-popover mode="right-absolute">
					Grafana Proxy默认删除转发的cookie。 按名称指定应转发到数据源的cookie。
				</info-popover>
			</div>
		</div>
	</div>

	<h3 class="page-heading">验证</h3>
	<div class="gf-form-group">
		<div class="gf-form-inline">
			<gf-form-checkbox class="gf-form" label="Basic Auth" checked="current.basicAuth" label-class="width-13" switch-class="max-width-6"></gf-form-checkbox>
			<gf-form-checkbox class="gf-form" label="随着凭据" tooltip="是否应使用跨站点请求发送cookie或auth标头等凭据。" checked="current.withCredentials" label-class="width-13"
			  switch-class="max-width-6"></gf-form-checkbox>
		</div>
		<div class="gf-form-inline">
			<gf-form-checkbox class="gf-form" ng-if="current.access=='proxy'" label="TLS 客户端认证" label-class="width-13"
			  checked="current.jsonData.tlsAuth" switch-class="max-width-6"></gf-form-checkbox>
			<gf-form-checkbox class="gf-form" ng-if="current.access=='proxy'" label="使用CA证书" tooltip="需要验证自签名TLS证书" checked="current.jsonData.tlsAuthWithCACert" label-class="width-13"
			  switch-class="max-width-6"></gf-form-checkbox>
		</div>
		<div class="gf-form-inline">
			<gf-form-checkbox class="gf-form" ng-if="current.access=='proxy'" label="跳过TLS验证" label-class="width-13"
			  checked="current.jsonData.tlsSkipVerify" switch-class="max-width-6"></gf-form-checkbox>
		</div>
		<div class="gf-form-inline">
			<gf-form-checkbox class="gf-form" ng-if="current.access=='proxy'" label="转发OAuth身份" label-class="width-13" tooltip="将用户的上游OAuth标识转发给数据源（它们的访问令牌被传递）。" checked="current.jsonData.oauthPassThru" switch-class="max-width-6"></gf-form-checkbox>
		</div>
	</div>

	<div class="gf-form-group" ng-if="current.basicAuth">
		<h6>基本身份验证详细信息</h6>
		<div class="gf-form" ng-if="current.basicAuth">
			<span class="gf-form-label width-10">用户</span>
			<input class="gf-form-input max-width-21" type="text"  ng-model='current.basicAuthUser' placeholder="用户" required></input>
		</div>
		<div class="gf-form">
      <secret-form-field
        isConfigured="current.basicAuthPassword || current.secureJsonFields.basicAuthPassword"
        value="current.secureJsonData.basicAuthPassword || ''"
        on-reset="onBasicAuthPasswordReset"
        on-change="onBasicAuthPasswordChange"
        inputWidth="18"
        labelWidth="10"
      />
		</div>
	</div>

<datasource-tls-auth-settings current="current" ng-if="(current.jsonData.tlsAuth || current.jsonData.tlsAuthWithCACert) && current.access=='proxy'">
</datasource-tls-auth-settings>
